From b0a74ddc59ef008f855784ca78dddd0cc31bd79d Mon Sep 17 00:00:00 2001 From: "kr.angelov" Date: Wed, 27 Nov 2013 12:35:11 +0000 Subject: added API in the C runtime and the Java binding for checking whether a given function is linearizable in a given language. This is used in the Android UI for better vizualizations --- src/runtime/c/pgf/pgf.c | 8 ++++++++ src/runtime/c/pgf/pgf.h | 27 +++------------------------ 2 files changed, 11 insertions(+), 24 deletions(-) (limited to 'src/runtime/c') diff --git a/src/runtime/c/pgf/pgf.c b/src/runtime/c/pgf/pgf.c index b9f555978..155b93135 100644 --- a/src/runtime/c/pgf/pgf.c +++ b/src/runtime/c/pgf/pgf.c @@ -158,3 +158,11 @@ pgf_print_name(PgfConcr* concr, PgfCId id) name = id; return name; } + +bool +pgf_has_linearization(PgfConcr* concr, PgfCId id) +{ + PgfCncOverloadMap* overl_table = + gu_map_get(concr->fun_indices, id, PgfCncOverloadMap*); + return (overl_table != NULL); +} diff --git a/src/runtime/c/pgf/pgf.h b/src/runtime/c/pgf/pgf.h index 606cb9940..20e6b1fa8 100644 --- a/src/runtime/c/pgf/pgf.h +++ b/src/runtime/c/pgf/pgf.h @@ -1,27 +1,3 @@ -/* - * Copyright 2010 University of Gothenburg. - * - * This file is part of libpgf. - * - * Libpgf is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or (at your - * option) any later version. - * - * Libpgf is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with libpgf. If not, see . - */ - -/** @file - * - * The public libpgf API. - */ - #ifndef PGF_H_ #define PGF_H_ @@ -114,6 +90,9 @@ pgf_function_type(PgfPGF* pgf, PgfCId funname); GuString pgf_print_name(PgfConcr*, PgfCId id); +bool +pgf_has_linearization(PgfConcr* concr, PgfCId id); + void pgf_linearize(PgfConcr* concr, PgfExpr expr, GuOut* out, GuExn* err); -- cgit v1.2.3